/**
 * @author:linjiye
 * @date:2025/2/27
 * @desc:
 **/

import {StyleSheet, Text, View,Image} from 'react-native'
import React from 'react'

type Props = {}

const Loading = ({style,iconStyle,text='生成文案中...',icon=require('../assets/images/gif/loading.gif')}: Props) => {
    return (
        <View style={[styles.container,style]}>
            <Image style={[styles.loading_gif,iconStyle]} source={icon}></Image>
            {text &&
                <Text style={styles.text}>{text}</Text>
            }
        </View>
    )
}

export default Loading

const styles = StyleSheet.create({
    container: {
        // flex: 1,
        justifyContent: "center",
        alignItems: "center",
        // position: "absolute",
        // top: 0,
        // left: 0,
        width: '100%',
        height: '100%',
        zIndex: 100,
        backgroundColor: 'white'
    },
    loading_gif: {
        width: 80,
        height: 80
    },
    text: {
        fontSize: 15,
        fontWeight: 500,
        color: 'rgba(0,0,0,0.9)',
        lineHeight: 24,
        marginTop: 11
    }
})